<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:70:"/var/www/html/tp5/public/../application/mobile/view/User/passedit.html";i:1530016210;s:57:"/var/www/html/tp5/application/mobile/view/User/index.html";i:1530081068;}*/ ?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="/static/mobile/css/bootstrap/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/mobile/css/login/login.css" />
    <script type="text/javascript" src="/static/mobile/js/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/static/mobile/js/bootstrap/bootstrap.min.js"></script>
</head>
<body>

<div class="">
    <div class="pull-left col-xs-12" style="background-color:#5C5C5C;color:#fff;padding:20px 0px;">
        <div class="col-xs-3 pull-left" style="margin:10px 0px;">
            <div class="img-pos">
                <a href="<?php echo url('mobile/User/index'); ?>">
                    <?php if(!empty($data['face'])): ?>
                    <img src="/uploads/<?php echo $data['face']; ?>" alt="默认头像" width="80">
                    <?php elseif(empty($data['face'])): ?>
                    <img src="/static/mobile/image/face.png" alt="默认头像" width="80">
                    <?php endif; ?>
                </a>
            </div>
        </div>
        <div class="col-xs-9 pull-right">
            <p style="border-bottom: 1px solid #fff;line-height: 50px;font-size: 24px;"><?php echo $data['name']; ?></p>
            <ul class="list-inline col-xs-12">
                <li class="col-xs-6" style="margin-bottom:10px;"><a href="<?php echo url('mobile/User/collect', ['id'=>$data['id']]); ?>" style="color:#fff;">收藏(<span id="fav-num"><?php echo $sc; ?></span>)</a></li>
                <li class="col-xs-6" style="margin-bottom:10px;"><a href="<?php echo url('mobile/User/comment', ['id'=>$data['id']]); ?>" style="color:#fff;">评论(<span id="com-num"><?php echo $pp; ?></span>)</a></li>
                <li class="col-xs-6"><a href="<?php echo url('mobile/User/edit', ['id'=>$data['id']]); ?>" style="color:#fff;">修改资料</a></li>
                <li class="col-xs-6"><a href="<?php echo url('mobile/User/passEd', ['id'=>$data['id']]); ?>" style="color:#fff;">修改密码</a></li>
            </ul>
        </div>
    </div>

<div class="col-xs-12" style="margin-top: 20px;">
    <table class="table table-striped">
        <input type="hidden" value="<?php echo $data['id']; ?>" name="id">
        <tr>
            <th>新密码</th>
            <td><input class="form-control" type="password" id="password" name="password" value=""></td>
        </tr>
        <tr>
            <th>重新输入密码</th>
            <td><input class="form-control" type="password" id="repassword" name="repassword" value=""></td>
        </tr>
        <tr>
            <th></th>
            <td><button class="form-control btn-success edit">修改密码</button></td>
        </tr>
    </table>
</div>
<script src="/static/index/js/jquery.min.js"></script>
<script src="/static/index/js/toastr.min.js"></script>
<link href="/static/admin/css/toastr.min.css" rel="stylesheet"/>

<script type="text/javascript">
    $(function(){
        $('.edit').click(function () {

            postdata();
        });
        function postdata(){
            //提交数据函数

            // console.log(123);
            $.ajax({

                //调用jquery的ajax方法
                type: "POST",
                //设置ajax方法提交数据的形式
                url: "/mobile/User/passUpdate",
                //把数据提交到ok.php
                data: {
                    password : $("#password").val(),
                    repassword: $("#repassword").val()
                    // sex : $(".sex").val()
                },
                success: function(data){
                    if (data) {
                        // toastr.success('修改成功,2秒后跳转');
                        // setInterval(function(){
                            location.href='http://47.96.69.12/mobile/user/index';
                        // }, 2000);
                    }else{
                        toastr.error('您没有修改任何内容！');
                    }
                },
                error: function () {
                    alert('交互操作失败');
                }
            });
            return false;
        }
    })
</script>

</div>

</body>
</html>
